#rmarkdown::draft("dashboard.Rmd", template = "flex_dashboard", package = "flexdashboard")
The flexdashboard website provides multiple advanced examples.
plotly::ggplotly(p1)